package com.test.langchain4j.config;

import com.test.langchain4j.service.MapMcpService;
import dev.langchain4j.model.chat.StreamingChatModel;
import java.util.List;
import java.util.Map;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 2025/8/8 16:09
 * @modifiedBy:
 * @version: 1.0
 */
@Configuration
public class MapMcpConfig {
  @Bean(name = "baiduMapMcpService")
  public MapMcpService baiduMcpService(StreamingChatModel streamingChatModel) {
    return AiServiceFactory.getAiService(
        MapMcpService.class,
        streamingChatModel,
        List.of("cmd", "/c", "npx", "-y", "@baidumap/mcp-server-baidu-map"),
        Map.of("BAIDU_MAP_API_KEY", "TMM7slQqgGUIyoay4WVrzZRMe3p3lL72"));
  }

  @Bean(name = "aMapMcpService")
  public MapMcpService gaodeMcpService(StreamingChatModel streamingChatModel) {
    return AiServiceFactory.getAiService(
        MapMcpService.class,
        streamingChatModel,
        List.of("cmd", "/c", "npx", "-y", "@amap/amap-maps-mcp-server"),
        Map.of("AMAP_MAPS_API_KEY", "73bbdf44cc6b352e574006ce51801d08"));
  }
}
